/**
 * This class is holder of event notification . 
 */
package ac.notification.event;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Ankush Chaudhary
 *
 */
public class NotificationEvent 
{
	private String notificationId;
	private String propertyIdentifier;
	private Object propertyValue;
	private Map<String, Object> additionalParameters;
		
	/**
	 * 
	 */
	public NotificationEvent() {
		super();
		additionalParameters = new HashMap<String, Object>(0);
		// TODO Auto-generated constructor stub
		
	}

	/**
	 * @param propertyIdentifier
	 */
	public NotificationEvent(String propertyIdentifier) {
		super();
		this.propertyIdentifier = propertyIdentifier;
		additionalParameters = new HashMap<String, Object>(0);
	}

	/**
	 * @return the propertyIdentifier
	 */
	public String getPropertyIdentifier() {
		return propertyIdentifier;
	}

	/**
	 * @return the propertyValue
	 */
	public Object getPropertyValue() {
		return propertyValue;
	}

	/**
	 * @param propertyIdentifier the propertyIdentifier to set
	 */
	public void setPropertyIdentifier(String propertyIdentifier) {
		this.propertyIdentifier = propertyIdentifier;
	}

	/**
	 * @param propertyValue the propertyValue to set
	 */
	public void setPropertyValue(Object propertyValue) {
		this.propertyValue = propertyValue;
	}
	
	public String toString()
	{
		StringBuffer stringBuffer = new StringBuffer();
		stringBuffer.append("Name: [" + propertyIdentifier + "]\t");
		if(null != propertyValue)
		{
			stringBuffer.append("Value: [" + propertyValue.toString() + "]");
		}
		
		return  stringBuffer.toString();
	}
	
	
	public void addParameter(String paramId,Object value)
	{
		this.additionalParameters.put(paramId, value);
	}
	
	public Object getParameter(String paramId)
	{
		return this.additionalParameters.get(paramId);
	}

	public String getNotificationId() {
		return notificationId;
	}

	public void setNotificationId(String notificationId) {
		this.notificationId = notificationId;
	}
}
